package com.example.model.vo;

import lombok.Data;

/**
 * @Author: ft
 * @Date:2025/8/21
 * @Description: 相关单据：
 */
@Data
public class ResponseResult<T> {

    private Integer code; //状态码

    private String message; //提示信息

    private T data; //数据

    public ResponseResult(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseResult() {
    }
    public static <T> ResponseResult<T> success(T data) {
        return new ResponseResult<>(200, "success", data);
    }
    public static ResponseResult<String> error(Integer code,String message) {
        return new ResponseResult<String>(code, message, null);
    }
}